package work.mediway.mdm.core.enums;


import cn.hutool.core.util.StrUtil;

/**
 * 数据
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/7/2
 */
public enum BusinessLogEnum {

    // 日志类型
    INSERT("A", "新增"),
    UPDATE("U", "修改"),
    DELETE("D", "删除"),
    IMPORT("I", "导入"),
    BIND("B", "关联");
    private String code;
    private String name;

    BusinessLogEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }


    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(String code) {
        for (BusinessLogEnum qt : BusinessLogEnum.values()) {
            if (StrUtil.equals(qt.getCode(), code)) {
                return qt.getName();
            }
        }
        return null;
    }


}